from django.urls import path
from apis.system.views import UserViewSet, DictionaryViewSet, RoleViewSet, MenuViewSet, MenuButtonViewSet, \
    OperationLogViewSet, UploadView, DeptViewSet
from utils.routers import CustomRouter

system_url = CustomRouter()
system_url.register(r'menu', MenuViewSet)
system_url.register(r'menu_button', MenuButtonViewSet)
system_url.register(r'role', RoleViewSet)
system_url.register(r'user', UserViewSet)
system_url.register(r'dictionary', DictionaryViewSet)
# system_url.register(r'file', FileViewSet)
system_url.register(r'operation_log', OperationLogViewSet)

urlpatterns = [
    path(r'upload/', UploadView.as_view()),
    path(r'dept/select/', DeptViewSet.as_view({'get': 'select'})),
    path(r'dept/no_level1_select/', DeptViewSet.as_view({'get': 'no_level1_select'})),
    path(r'user/update_info/', UserViewSet.as_view({'put': 'update_info'})),
]
urlpatterns += system_url.urls
